//
//  hotDiscussTableViewCell.m
//  LT
//
//  Created by dllo on 16/5/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "hotDiscussTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation hotDiscussTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
    
}

-(void)createSubViews{
  
//    photoImage
//    authorLabel
//    titleLabel;
//    countryLabel;
//    reply_timeLabel;
//    reply_numLabel;
    
    self.authorLabel = [[UILabel alloc]init];
   // self.authorLabel.backgroundColor = [UIColor grayColor];
    self.authorLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.authorLabel];
    
    self.titleLabel = [[UILabel alloc]init];
  //  self.titleLabel.backgroundColor = [UIColor yellowColor];
    self.titleLabel.numberOfLines = 2;
    [self.contentView addSubview:self.titleLabel];
    
    self.countryLabel = [[UILabel alloc]init];
 //   self.countryLabel.backgroundColor = [UIColor blueColor];
    self.countryLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.countryLabel];
    
    self.reply_timeLabel = [[UILabel alloc]init];
 //   self.reply_timeLabel.backgroundColor = [UIColor greenColor];
    
    [self.contentView addSubview:self.reply_timeLabel];
    
    self.reply_numLabel = [[UILabel alloc]init];
  //  self.reply_numLabel.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.reply_numLabel];
    
    self.avatar = [[UIImageView alloc]init];
  //  self.avatar.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:self.avatar];
    
}



-(void)layoutSubviews{
    [super layoutSubviews];
    self.avatar.frame = CGRectMake(5* WIDTHCELL, 5* WIDTHCELL, 30* WIDTHCELL, 30* WIDTHCELL);
    self.authorLabel.frame = CGRectMake(50* WIDTHCELL, 30* WIDTHCELL, 100* WIDTHCELL, 20* WIDTHCELL);
    self.titleLabel.frame = CGRectMake(50* WIDTHCELL, 60* WIDTHCELL, (self.contentView.frame.size.width - 50)* WIDTHCELL, 50* WIDTHCELL);
    self.countryLabel.frame = CGRectMake(50* WIDTHCELL, 120* WIDTHCELL, 50* WIDTHCELL, 30* WIDTHCELL);
    self.reply_timeLabel.frame = CGRectMake(200* WIDTHCELL, 120* WIDTHCELL, 100* WIDTHCELL, 30* WIDTHCELL);
    self.reply_numLabel.frame = CGRectMake(300* WIDTHCELL, 120* WIDTHCELL, 60* WIDTHCELL, 30* WIDTHCELL);
   
    
    
}


//set传值
-(void)setModel:(hotDisModel *)model{
    _model = model;
    self.authorLabel.text = _model.author;
    self.titleLabel.text = _model.title;
    self.reply_timeLabel.text = _model.reply_time;
    self.reply_numLabel.text = [_model.reply_num stringValue];


}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
